import React, { Component } from 'react';

class List extends Component {
	static defaultProps = {
		toDetail() { }
	}
	render() {
		const { list, toDetail, vertical } = this.props
		return (
			<div className={vertical ? 'list col' : 'list'}>
				{
					list.length > 0 && list.map(v => {
						return (
							<dl key={v.id} onClick={() => toDetail(v)}>
								<dt>
									<img src={v.url} alt="" />
								</dt>
								<dd>
									<h3>{v.title}</h3>
									<p>{v.desc}</p>

								</dd>
							</dl>
						)
					})
				}
			</div>
		);
	}
}

export default List;
